package com.ls.blog.DTO;

import io.swagger.models.auth.In;
import lombok.*;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.util.Collection;

/**
 * @program: blog
 * @author: lishun
 * @create: 2021-09-20 11:07
 **/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@Data
public class UserDetailsDTO implements UserDetails {
    private Integer id;

    private String username;

    private String password;


    private Collection<? extends GrantedAuthority> authorities;





    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return this.password;
    }

    @Override
    public String getUsername() {
        return this.username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return true;
    }

}
